package com.bw.liuyushan.mvp_lib.Presenter;

import com.bw.liuyushan.mvp_lib.Model.IModel;
import com.bw.liuyushan.mvp_lib.VIew.IView;

import io.reactivex.disposables.Disposable;

/**
 * Liuyushan20210904
 * file name is : BaseModel
 * created by Ender on 2021/9/4 8:09.
 * author : 刘雨杉
 * Describe:
 */
public class BasePresenter<M extends IModel,V extends IView> implements IPresenter{
    protected M mModel;
    protected V mView;
    Disposable disposable;//RxJava内存泄露

    public BasePresenter(M mPresenter, V mView) {
        this.mModel = mPresenter;
        this.mView = mView;
    }

    @Override
    public void Destory() {//RxJava内存泄露
        if (disposable!=null){
            disposable.dispose();
            disposable=null;
        }
    }
}
